﻿#ifndef __CAN_H__
#define __CAN_H__

#include <stdint.h>

#define CAN_EXTEND_FLAG  0x80000000U
#define CAN_EXTEND_MASK  0x1FFFFFFFU

struct canmsg_filter {
	uint32_t can_id;
	uint32_t can_mask;
};

struct can_handle {
	int socket;
	char dev_name[32];
};

struct  can_handle*    can_open(const char *dev, int bitrate, int filter_num, struct canmsg_filter *filter_tab);
void    can_close(struct can_handle *handle);
int     can_write(void *ctx, unsigned int id, unsigned char *data, int bytes);



#endif
